<script setup>
const props = defineProps({
  item: {
    type: Object,
  },
})
console.log('props', props.item)
</script>

<template>
  <div v-if="props.item?.name" class="body">
    <div class="left">
      <div class="img">
        <img :src="props.item?.avatar" />
      </div>
      <div class="name">{{ props.item?.name }}</div>
    </div>
    <div v-if="props.item?.type === 'group'" class="num">(1)</div>
  </div>
</template>

<style lang="scss" scoped>
img {
  border-radius: 50%;
  width: 30px;
  height: 30px;
}
.body {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  .left {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    margin-left: 10px;
    border-right: none;

    .img {
      margin: 0 5px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
  .num {
    margin-right: 10px;
  }
}
</style>
